// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   getNameFromID.java

package include.get_name_from_ID;

import include.nseer_db.nseer_db;
import java.sql.ResultSet;

public class getNameFromID
{

	public getNameFromID()
	{
	}

	public String getNameFromID(String unit_db_name, String table_name, String field_name, String file_ID, String field_name1)
	{
		nseer_db db = new nseer_db(unit_db_name);
		String getNameFromID = "";
		try
		{
			String sql = (new StringBuilder("select ")).append(field_name1).append(" from ").append(table_name).append(" where ").append(field_name).append("='").append(file_ID).append("'").toString();
			ResultSet rs = db.executeQuery(sql);
			if (rs.next())
				getNameFromID = rs.getString(field_name1);
			db.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return getNameFromID;
	}

	public String getNameFromID(String unit_db_name, String table_name, String field_name1, String file_ID1, String filed_name2, String file_ID2, String field_name3)
	{
		nseer_db db = new nseer_db(unit_db_name);
		String getNameFromID = "";
		try
		{
			String sql = (new StringBuilder("select ")).append(field_name3).append(" from ").append(table_name).append(" where ").append(field_name1).append("='").append(file_ID1).append("' and ").append(filed_name2).append("='").append(file_ID2).append("'").toString();
			ResultSet rs = db.executeQuery(sql);
			if (rs.next())
				getNameFromID = rs.getString(field_name3);
			db.close();
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
		return getNameFromID;
	}
}
